home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 131 / XENIATGM131.iso / Goodies / I-WAR 2 Egde of Chaos - New SDK / IW2-EOC_Pog_Scripting_SDK.exe / include / iSim.h < prev    next >
C/C++ Source or Header  |  2002-01-14  |  12KB  |  482 lines

  1. //
  2. // (c) 1999 Particle Systems Ltd. All Rights Reserved
  3. //
  4. // iSim.h
  5. //
  6. // API for the package iSim.
  7. //
  8. // Revision control information:
  9. //
  10. // $Header:
  11. //
  12.  
  13. #include "Flux.h"
  14.  
  15. #ifdef FLUX_COMPILE
  16.  
  17. FLUX_DECLARE_EXTENSION(iSim);
  18.  
  19. #ifdef FLUX_LIB
  20. #if _MSC_VER >= 1000
  21. #pragma comment( lib, "isim" )
  22. #endif // _MSC_VER >= 1000
  23. #endif // FLUX_LIB
  24.  
  25. // Types of sim. Can be combined as a bitfield - included during C++ build
  26. // so that the types can be referenced safely by name.
  27. enum eSimType
  28. {
  29.     // No type
  30.     T_None                = 0x00000000,
  31.  
  32.     // Celestial bodies
  33.     T_Star                = 0x00000001,
  34.     T_Planet            = 0x00000002,
  35.     T_Nebula            = 0x00000004,
  36.  
  37.     // Non-ships (not avoided)
  38.     T_Waypoint            = 0x00000008,
  39.     T_LagrangePoint        = 0x00000010,
  40.     T_Probe                = 0x00000020,
  41.  
  42.     // Weapons
  43.     T_Weapon            = 0x00000040,
  44.     T_Missile            = 0x00000080,
  45.     T_Mine                = 0x00000100,
  46.  
  47.     // Camera dolly (not avoided)
  48.     T_Dolly             = 0x00000200,
  49.  
  50.     // Non-ships
  51.     T_Asteroid            = 0x00000400,
  52.     T_CargoPod            = 0x00000800,
  53.  
  54.     // Bases
  55.     T_Gunstar            = 0x00001000,
  56.     T_Station            = 0x00002000,
  57.     T_BioBomber            = 0x00004000,
  58.  
  59.     // Ships (in rough size order)
  60.     T_Drone                = 0x00008000,
  61.     T_Waldo                = 0x00010000,    
  62.     T_CommandSection    = 0x00020000,
  63.     T_Utility            = 0x00040000,    
  64.     T_Passenger            = 0x00080000,    
  65.     T_Fighter            = 0x00100000,
  66.     T_Tug                = 0x00200000,
  67.     T_Patcom            = 0x00400000,
  68.     T_Interceptor        = 0x00800000,
  69.     T_Corvette            = 0x01000000,
  70.     T_Freighter            = 0x02000000,
  71.     T_Destroyer            = 0x04000000,
  72.     T_Cruiser            = 0x08000000,
  73.     T_Carrier            = 0x10000000,
  74.  
  75.     // Other things 
  76.     T_Alien             = 0x20000000,
  77.  
  78.     // Multiplayer features
  79.     T_PowerUp           = 0x40000000,
  80.  
  81.     //
  82.     // Masks (combinations)
  83.     //
  84.  
  85.     // All celestial phenomena
  86.     TM_CelestialBody    = T_Star | 
  87.                           T_Planet | 
  88.                           T_Nebula,
  89.  
  90.     // All ships
  91.     TM_Ship                = T_Drone |
  92.                           T_Waldo |
  93.                           T_CommandSection |
  94.                           T_Utility |
  95.                           T_Passenger | 
  96.                           T_Fighter |
  97.                           T_Tug |
  98.                           T_Patcom |
  99.                           T_Corvette |
  100.                           T_Freighter |
  101.                           T_Destroyer |
  102.                           T_Cruiser |
  103.                           T_Interceptor |
  104.                           T_Carrier
  105. };
  106.  
  107. //
  108. // For explosions
  109. //
  110. enum eExplosion
  111. {
  112.     SE_Normal,
  113.     SE_AntiMatter
  114. };
  115.  
  116. #else
  117.  
  118. // Dependency on sim
  119. uses Sim;
  120.  
  121. // Declare the I-War 2 sim handle type
  122. handle hisim : hsim;
  123.  
  124. // Dependencies
  125. uses iFaction, iMapEntity;
  126.  
  127. //
  128. // hisim iSim.Cast( hobject object_handle )
  129. //
  130. // Create a hisim handle as a dynamic cast from the hobject
  131. //
  132. prototype hisim iSim.Cast( hobject object_handle );
  133.  
  134. //
  135. // eSimType iSim.Type( hobject object_handle )
  136. //
  137. // Return the type of sim.
  138. //
  139. prototype eSimType iSim.Type( hobject object_handle );
  140.  
  141. //
  142. // Kill( hisim sim )
  143. //
  144. // Destroys a sim and removes it from the world (with explosions)
  145. //
  146. prototype iSim.Kill( hisim sim );
  147.  
  148. //
  149. // CreateExplosion( hisim sim )
  150. //
  151. // Creates an explosion for the sim. The sim is unharmed and not destroyed.
  152. //
  153. prototype iSim.CreateExplosion( hisim sim );
  154.  
  155. //
  156. // hfaction iSim.Faction( hisim sim_handle )
  157. //
  158. // Find the faction handle of an isim
  159. //
  160. prototype hfaction iSim.Faction( hisim sim_handle );
  161.  
  162. //
  163. // iSim.SetFaction( hisim sim_handle, hfaction faction )
  164. //
  165. // Set the faction of an isim
  166. //
  167. prototype iSim.SetFaction( hisim sim_handle, hfaction faction );
  168.  
  169. //
  170. // set iSim.SimsInRadius( hisim sim, float radius, enum eSimType type )
  171. //
  172. // Returns all sims of a particular type within the given radius around the 
  173. // given sim except for the given sim
  174. //
  175. prototype set iSim.SimsInRadius( hisim sim, float radius, int type );
  176.  
  177. //
  178. // set iSim.SimsInRadiusOfFaction( hisim sim, float radius, hfaction faction )
  179. //
  180. // Returns all sims of a particular faction within the given radius around the given
  181. // sim except for the given sim.
  182. //
  183. prototype set iSim.SimsInRadiusOfFaction( hisim sim, float radius, hfaction faction );
  184.  
  185. //
  186. // set iSim.SimsInCone( hisim sim, float start_width, float end_width, float length, enum eSimType type )
  187. //
  188. // Returns all sims of the given type in the cone or cylinder defined by the arguments
  189. // except for the given sim
  190. //
  191. prototype set iSim.SimsInCone( hisim sim, float start_width, float end_width, float length, int type );
  192.  
  193. //
  194. // set iSim.SimsInCylinder( hisim sim, float start_width, float end_width, float length, enum eSimType type )
  195. //
  196. // Returns all sims of the given type in the cone or cylinder defined by the arguments except for the given sim
  197. //
  198. prototype set iSim.SimsInCylinder( hisim sim, float width, float length, int type );
  199.  
  200. //
  201. // set iSim.SimsInRadiusFromSet( 
  202. //    set set_of_sims,
  203. //    hisim sim, 
  204. //    float radius, 
  205. //    enum eSimType type )
  206. //
  207. // Returns all sims of a particular type within the given radius around the 
  208. // given sim except for the given sim
  209. //
  210. prototype set iSim.SimsInRadiusFromSet( 
  211.     set set_of_sims,
  212.     hisim sim, 
  213.     float radius, 
  214.     int type );
  215.  
  216. //
  217. // set iSim.ShipsInRadius( hisim sim, float radius )
  218. //
  219. // Returns all ships within the given radius around the given sim except 
  220. // for the given sim.
  221. //
  222. prototype set iSim.ShipsInRadius( hisim sim, float radius );
  223.  
  224. //
  225. // set iSim.NonPlanetaryInRadius( hisim sim, float radius )
  226. //
  227. // Returns all non-planetary map entities (habitats and l-points) within the 
  228. // given radius around the given sim except for the given sim
  229. //
  230. prototype set iSim.NonPlanetaryInRadius( hisim sim, float radius );
  231.  
  232. //
  233. // bool iSim.IsDocked( hisim sim )
  234. //
  235. // Return whether or not this sim is docked to anything.
  236. //
  237. prototype bool iSim.IsDocked( hisim sim );
  238.  
  239. //
  240. // bool iSim.IsDockedTo( hisim sim1, hisim sim2 )
  241. //  
  242. // Returns whether or not the given sims are docked together
  243. //
  244. prototype bool iSim.IsDockedTo( hisim sim1, hisim sim2 );
  245.  
  246. //
  247. // bool iSim.IsDockedToStructure( hisim sim1, hisim sim2 )
  248. //
  249. // Returns true if sim1 is docked to sim2 or any of its children.
  250. //
  251. prototype bool iSim.IsDockedToStructure( hisim sim1, hisim sim2 );
  252.  
  253. //
  254. // iSim.SetDockingLock( hisim sim1, hisim sim2, bool lock )
  255. //
  256. // Locks or unlocks any docking ports between sim1 and sim2.  For this 
  257. // function to be of any use sim1 should be docked to the sim2.  Note that
  258. // that unlock does not undock the two sims it mearly makes undocking possible.
  259. // bool lock = on/off
  260. //
  261. prototype iSim.SetDockingLock( hisim sim1, hisim sim2, bool lock );
  262.  
  263. //
  264. // iSim.Dock( hisim sim1, hisim sim2 )
  265. //
  266. // Attempt to dock sim1 to sim2.
  267. //
  268. prototype bool iSim.Dock( hisim sim1, hisim sim2 );
  269.  
  270. //
  271. // iSim.Undock( hisim sim1, hisim sim2 )
  272. //
  273. // Undock sim1 from sim2.
  274. //
  275. prototype bool iSim.Undock( hisim sim1, hisim sim2 );
  276.  
  277. //
  278. // SetSensorVisibility( hisim waypoint, bool visible )
  279. //
  280. // Sets the visibility of the given iiSim
  281. //
  282. prototype iSim.SetSensorVisibility( hisim waypoint, bool visible );
  283.  
  284. //
  285. // SetStandardSensorVisibility( hisim waypoint, bool visible )
  286. //
  287. // Sets the standard visibility of the given iiSim.  Note that this overrides
  288. // SetSensorVisibility in removing the forced sensibility (visible from all 
  289. // systems) and replacing it with standard local visibility.
  290. //
  291. prototype iSim.SetStandardSensorVisibility( hisim the_sim, bool visible );
  292.  
  293. //
  294. // bool IsIndestructable( hisim sim )
  295. //
  296. // Returns TRUE if the given sim is flagged as interesting.
  297. //
  298. prototype bool iSim.IsIndestructable( hisim sim );
  299.  
  300. //
  301. // bool iSim.Attacked( hisim ship )
  302. //
  303. // Returns true if the sim has been attacked.
  304. //
  305. prototype bool iSim.Attacked( hisim ship );
  306.  
  307. //
  308. // hisim iSim.LastAttacker( hisim ship )
  309. //
  310. // Returns the last iSim to have attacked the given sim.
  311. //
  312. prototype hisim iSim.LastAttacker( hisim ship );
  313.  
  314. //
  315. // bool IsMissionCritical( hisim sim )
  316. //
  317. // Returns TRUE if the given sim is flagged as mission critical.
  318. //
  319. prototype bool iSim.IsMissionCritical( hisim sim );
  320.  
  321. //
  322. // string ActiveWorld()
  323. //
  324. // Returns the name of the active world as a string - returns Loading if the 
  325. // system is loading
  326. //
  327. prototype string iSim.ActiveWorld();
  328.  
  329. //
  330. // string iSim.WorldName( hisim sim )
  331. //
  332. // Returns the current world name of the sim in question - returns Loading if 
  333. // the system is loading or None if the sim is not in a world.
  334. //
  335. prototype string iSim.WorldName( hisim sim );
  336.  
  337. //
  338. // SetIndestructable( hisim sim, bool flag)
  339. //
  340. // Sets the interesting flag of the sim
  341. //
  342. prototype iSim.SetIndestructable( hisim sim, bool flag );
  343.  
  344. //
  345. // SetMissionCritical( hisim sim, bool flag)
  346. //
  347. // Sets the mission critical flag of the sim
  348. //
  349. prototype iSim.SetMissionCritical( hisim sim, bool flag );
  350.  
  351. //
  352. // hisim FindByNameInSystem( string name, string system )
  353. //
  354. // Returns the handle of the first sim matching the given name in the given system.
  355. //
  356. prototype hisim iSim.FindByNameInSystem( string name, string system );
  357.  
  358. //
  359. // set FindByWildcardInSystem( string wildcard, string system )
  360. //
  361. // Returns the set of hisim handles which match the given wildcard in the given system
  362. //
  363. prototype set iSim.FindByWildcardInSystem( string wildcard, string system );
  364.  
  365. //
  366. // CapsuleJump( hisim sim, hisim destination )
  367. //
  368. // Cause sim to perform a capsule jump to the given destination. The
  369. // destination can be in the same system or another system.  The exit
  370. // point will be along the destination jump point's local Z.
  371. //
  372. prototype iSim.CapsuleJump( hisim sim, hisim destination );
  373.  
  374. //
  375. // CapsuleJumpStaggered( hisim sim, hisim destination )
  376. //
  377. // Cause sim to perform a capsule jump to the given destination. The
  378. // destination can be in the same system or another system.  The exit point
  379. // will be staggered.
  380. //
  381. prototype iSim.CapsuleJumpStaggered( hisim sim, hisim destination );
  382.  
  383. prototype iSim.CapsuleJumpCustom( hisim sim, hisim destination, float exit_x, float exit_y, float exit_speed );
  384.  
  385. //
  386. // IsCapsuleJumping( hisim sim )
  387. //
  388. // Returns true if the given sim is capsule jumping
  389. //
  390. prototype bool iSim.IsCapsuleJumping( hisim sim );
  391.  
  392.  
  393. //
  394. // IsRespawning( hisim sim )
  395. //
  396. // Returns true if the given sim is respawning in a multiplayer game
  397. //
  398. prototype bool iSim.IsRespawning( hisim sim );
  399.  
  400. //
  401. // SetAlienInfectionDamage( hisim sim, float damage_per_second )
  402. //
  403. // Infect the sim by an alien. Starts damage by the given rate. 
  404. //
  405. prototype iSim.SetAlienInfectionDamage( hisim sim, float rate );
  406.  
  407. //
  408. // AlienInfectionEffect( hisim sim, bool on )
  409. //
  410. // Infect the sim by an alien. Starts damage by the given rate. 
  411. //
  412. prototype iSim.AlienInfectionEffect( hisim sim, bool on );
  413.  
  414. //
  415. // AlienInfectionDamage(hisim sim)
  416. //
  417. // Return the alien infection damage rate (damage per second)
  418. //
  419. prototype float iSim.AlienInfectionDamage( hisim sim );
  420.  
  421. //
  422. // IsAlienInfectionEffectOn(hisim sim)
  423. //
  424. // return true if the alien effect is on the given sim
  425. //
  426. prototype bool iSim.IsAlienInfectionEffectOn( hisim sim);
  427.  
  428. //
  429. // iSim.IsDying
  430. //
  431. // Returns TRUE if a sim has been killed and is either A) exploding
  432. // or B) has a death script running.
  433. //
  434. prototype bool iSim.IsDying( hisim sim );
  435.  
  436. //
  437. // iShip.PlayerHostilesInRadius
  438. //
  439. // Returns a set of hostiles within a specified range of the player.
  440. //
  441. prototype set iSim.PlayerHostilesInRadius( float radius, int mask );
  442.  
  443. //
  444. // Start an explosion of on the sim
  445. //
  446. prototype iSim.StartExplosion(hisim sim);
  447.  
  448. //
  449. // Stop the explosion on a sim, with given explosion type and optionally destroying the sim
  450. //
  451. prototype iSim.StopExplosion(hisim sim, eExplosion explosion, bool destroy_sim);
  452.  
  453. //
  454. // iSim.LockDownWeapons( hship ship )
  455. //
  456. // Locks all weapons down on the sim.  Returns TRUE if it succeeded
  457. //
  458. prototype bool iSim.LockDownWeapons( hisim sim );
  459.  
  460. //
  461. // iSim.WeaponTargetFromContactList( hship ship)
  462. //
  463. // Sets all weapon targets to their own devices (or contact list)
  464. //
  465. prototype bool iSim.WeaponTargetsFromContactList( hisim sim );
  466.  
  467. //
  468. // iSim.WeaponsUseExplicitTarget( hship ship, hisim target )
  469. //
  470. // Sets all weapons to fire on a specific sim.
  471. //
  472. prototype bool iSim.WeaponsUseExplicitTarget( hisim sim, hisim target );
  473.  
  474. //
  475. // iSim.SetHostile( bool state )
  476. //
  477. // Sets this sim (non-)hostile to the player
  478. //
  479. prototype iSim.SetHostile( hisim sim, bool state );
  480.  
  481. #endif // FLUX_LIB
  482.